<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'editCollege.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script src="<%=basePath %>js/main.js" type="text/javascript"></script>
    <script language="JavaScript" src="/course/js/validation-framework.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link rel="stylesheet" href="../css/adminStyle.css" type="text/css" />
  </head>
  
  <body >
  
  <form action="<%=basePath%>admin/teacherService.do?method=editTeacher" method="post" id="editTeacherForm" name="editTeacherForm" onSubmit="return doValidate('editTeacherForm')">
		<input name="id" id="id" value="${teacher.id }" type="hidden">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td align="center" valign="top"><table width="300" border="1" cellspacing="0" cellpadding="0">
              <tr>
		 
            <td><div align="right">所属学院：</div></td>
            <td><select name="collegeId" id="collegeId" onChange="getDepartment()">
              	<c:forEach items="${collegeList}" var="col">
              		<c:if test="${col.id eq collegeId}">
              			<option value="${col.id}" selected="selected" >${col.name }</option>
              		</c:if>
              		<c:if test="${col.id ne collegeId}">
              			<option value="${col.id}">${col.name }</option>
              		</c:if>
              	</c:forEach>
              </select>
              </td>
         </tr>
          <tr>
            <td><div align="right">所属系所：</div></td>
            <td>
            <select name="departmentId" id="departmentId" onChange="getSpecialty()">
              	<c:forEach items="${departmentList}" var="dep">
              		<c:if test="${dep.id eq departmentId}">
              			<option value="${dep.id}" selected="selected" >${dep.name }</option>
              		</c:if>
              		<c:if test="${dep.id ne departmentId}">
              			<option value="${dep.id}">${dep.name }</option>
              		</c:if>
              	</c:forEach>
              </select>
              </td>
          </tr>
               <tr>
                <td><div align="right">教师编号：</div></td>
                <td><input name="username" id="username" value="${teacher.username}"></td>
              </tr>
              <tr>
                <td><div align="right">教师姓名：</div></td>
                <td><input name="name" id="name" value="${teacher.name}"></td>
              </tr>
               <tr>
                <td><div align="right">用户密码：</div></td>
                <td><input name="password" id="password" type="password" value="${teacher.password}"></td>
              </tr>
              <tr>
                <td><div align="right">出生日期：</div></td>
                <td><input name="birthday" id="birthday" value="${teacher.birthday}" onFocus="HS_setDate(this)"></td>
              </tr>
              <tr>
                <td><div align="right">性别：</div></td>
                <td>
                <select name="sex" id="sex">
                <c:if test='${teacher.sex eq "男"}'>
                	<option value="男" selected="selected">男</option>
                  <option value="女">女</option>
                </c:if>
                <c:if test='${teacher.sex eq "女"}'>
                	<option value="男">男</option>
                  <option value="女" selected="selected">女</option>
                </c:if>
                  <c:if test="${teacher.sex == null}">
                	<option value="男">男</option>
                  <option value="女">女</option>
                </c:if>
                </select>
                </td>
              </tr>
               <tr>
                <td><div align="right">电话：</div></td>
                <td><input name="telephone" id="telephone" value="${teacher.telephone}"></td>
              </tr>
              <tr>
                <td><div align="right">email：</div></td>
                <td><input name="email" id="email" value="${teacher.email}"></td>
              </tr>
              <tr>
                <td><div align="right">
                    <input type="submit" value="提交">
                </div></td>
                <td><input name="重置" type="reset" value="重置"></td>
              </tr>
            </table></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>
    <br>
  </form>
   
  </body>
</html>